package com.hc.server.conn.bill;

import org.json.JSONException;
import org.json.JSONObject;

public class BillRequest {
	
	private static final String ACTION_NAME = "ACTION_NAME";
	private static final String ACTION_INFO = "ACTION_INFO";
	private static final String ACTION_MODULE = "ACTION_MODULE";
	private static final String ACTION_INVOKER = "ACTION_INVOKER";

	private JSONObject req;
	private JSONObject info;
	
	public BillRequest(){
		req = new JSONObject();
		info = new JSONObject();
		try {
			req.put(ACTION_INFO, info);
			req.put(ACTION_INVOKER, "lvyoushangcheng");
			req.put(ACTION_MODULE, "BILL_INTERFACE");
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	
	public void setActionName(String name){
		try {
			req.put(ACTION_NAME, name);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	
	public void put(String key, Object value){
		try {
			req.put(key, value);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	
	public void put(String key, int value){
		try {
			req.put(key, value);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	
	public String toString(){
		return req.toString();
	}
}
